package eg.backend.manager.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;

import eg.backend.domain.Feedback;
import eg.backend.manager.FeedbackManager;
import eg.backend.manager.UserManager;
import eg.backend.repository.FeedbackRepository;

public class FeedbackManagerImpl implements FeedbackManager {
	@Autowired
	private FeedbackRepository feedbackRepository;
	@Autowired
	private UserManager userManager;
	
	public void add(String comment) {
		Feedback e = new Feedback();
		e.setComment(comment);
		e.setOwner(userManager.getCurrentUser());
		e.setCreatedTime(new Date());
		feedbackRepository.save(e);
	}

}
